package com.dubbo.ssmcaseconsumeboot;

import com.alibaba.dubbo.config.annotation.Reference;
import fv.service.TestService;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.ImportResource;

@ImportResource(locations = {"classpath:spring-dubbo-consumer2.xml"})
@SpringBootApplication
public class SsmcaseconsumebootApplication {
    public static void main(String[] args) {
        //SpringApplication.run(SsmcaseconsumebootApplication.class, args);
        ApplicationContext applicationContext=SpringApplication.run(SsmcaseconsumebootApplication.class,args);
        TestService testService=applicationContext.getBean(TestService.class);
        System.out.println(testService.getTestById(1));
        System.out.println(testService.getAllTest());
        fv.pojo.Test test=new fv.pojo.Test();
        test.setTest1(3);
        test.setTest2("test3");
        System.out.println(testService.addTest(test));
        fv.pojo.Test tes2=new fv.pojo.Test();
        tes2.setTest1(3);
        tes2.setTest2("test3");
        tes2.setId(3);
        System.out.println(testService.updateTest(tes2));
        System.out.println(testService.deleteTest(14));
    }

}
